package com.uinnova.springboot.encache;


import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Api
public class CacheController {

    @Autowired
    private CacheService cacheService;

    @GetMapping(value = "/jail/cache/{id}")
    public String getCache(@PathVariable String id){
          return cacheService.getCache(id);
    }

    @GetMapping(value = "/jail/cacheEvict/{id}")
    public void cahceEvict(@PathVariable String id){
        cacheService.cacheEvict(id);
    }

    @GetMapping(value = "/jail/cachePut/{id}")
    public void cachePut(@PathVariable String id){
        cacheService.cachePut(id);
    }
}
